import axios from 'axios';
var Promise2 = require('bluebird')
exports.firstLetter =  function (str, o) {
    // body...
    if (!str) {
        return ""
    }
    var re =  test(str)

  //  console.log("在模块中" + re);
    return re

};


async function test(str) {

    var re = await test2(str);
  //  console.log("在test中" + re);

    return re;
}

function test2(str) {
    return new Promise2((resolve, reject) => {


        axios.post("/a", {
            class: "comm",
            para: "getFirstLetter",
            j: { str: str }

        }).then((res) => {

            resolve(res.data.str)


        });
    })

}